home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / adaptor.zip / ADAPT.ZIP / adaptor / src / include / definiti.h < prev    next >
C/C++ Source or Header  |  1993-07-08  |  12KB  |  270 lines

  1. # ifndef yyDefinitions
  2. # define yyDefinitions
  3.  
  4. # if defined __STDC__ | defined __cplusplus
  5. # define ARGS(parameters)    parameters
  6. # else
  7. # define ARGS(parameters)    ()
  8. # endif
  9.  
  10.  
  11. # ifndef bool
  12. # define bool char
  13. # endif
  14. # define NoDefinitions (tDefinitions) 0L
  15. # define kScopes 1
  16. # define kSCOPE_LIST 2
  17. # define kSCOPE_EMPTY 3
  18. # define kEntries 4
  19. # define kENTRY_LIST 5
  20. # define kENTRY_EMPTY 6
  21. # define kObject 7
  22. # define kVarObject 8
  23. # define kTemplateObject 9
  24. # define kProcessorsObject 10
  25. # define kTypeObject 11
  26. # define kProcObject 12
  27. # define kFuncObject 13
  28. # define kBlockObject 14
  29. # define kModuleObject 15
  30. # define kCommonObject 16
  31. # define kNameListObject 17
  32. # define kDistribution 18
  33. # define kDefaultDistribution 19
  34. # define kArrayUseDistribution 20
  35. # define kSerialDistribution 21
  36. # define kHostDistribution 22
  37. # define kNodeDistribution 23
  38. # define kAlignDistribution 24
  39. # define kVarDescription 25
  40. # define kVarDummy 26
  41. # define kVarConstant 27
  42. # define kVarLocal 28
  43. # define kVarCommon 29
  44.  
  45. typedef unsigned char Definitions_tKind;
  46. typedef unsigned short Definitions_tMark;
  47. typedef unsigned short Definitions_tLabel;
  48. typedef union Definitions_Node * tDefinitions;
  49. typedef void (* Definitions_tProcTree) ();
  50. /* line 22 "definitions.cg" */
  51.  
  52.  
  53. # define FORTRAN
  54.  
  55. # define arr_illegal      -1
  56. # define arr_fixed_size    0
  57. # define arr_automatic     1
  58. # define arr_allocatable   2
  59. # define arr_assumed_size  3
  60.  
  61. # define NoObject       NoDefinitions
  62.  
  63. # define tDistribution  tDefinitions  /* type for distributions            */
  64. # define tObject        tDefinitions  /* type for object descriptors       */
  65. # define tEntries       tDefinitions  /* type to represent sets of decls.  */
  66. # define tScopes        tDefinitions  /* type to represent scopes          */
  67.  
  68. # include "Idents.h"
  69. # include "Tree.h"
  70. # include "global.h"     /* MAX_DIMENSIONS */
  71.  
  72.     /*****************************************
  73.     *                                        *
  74.     *  Arrays for distributed dimensions     *
  75.     *                                        *
  76.     *****************************************/
  77.  
  78. typedef struct {
  79.      int no_dims;
  80.      int DimsArray [MAX_DIMENSIONS];
  81.      } DistributedDimensions;
  82.  
  83.     /*****************************************
  84.     *                                        *
  85.     *  Searching Objects                     *
  86.     *                                        *
  87.     *****************************************/
  88.  
  89. /* searching in a given Scope */
  90.  
  91. tObject GetDeclEntry ARGS((tIdent Ident, tEntries Decls));
  92.  
  93. /* searching in last scope : ScopeList */
  94.  
  95. tObject GetLocalDecl ARGS((tIdent Ident));
  96.  
  97. /* searching in all scopes : ScopeList */
  98.  
  99. tObject GetGlobalDecl ARGS((tIdent Ident));
  100.  
  101. /* searching in Unit/External/Intrinsic Subrouitines */
  102.  
  103. tObject GetOtherDecl ARGS((tIdent Ident));
  104.  
  105.     /*****************************************
  106.     *                                        *
  107.     *  Handling Scopes                       *
  108.     *                                        *
  109.     *****************************************/
  110.  
  111. void NewScope ();                        /* opening new empty scope */
  112.  
  113. void OpenScope ARGS((tEntries Entries)); /* open given scope */
  114.  
  115. void CloseScope (/* */);                 /* close last scope */
  116.  
  117. tEntries GetCurrentScope ();             /* get the current Scope */
  118.  
  119. tEntries GetExternalEntries ();          /* get Scope with Externals  */
  120. tEntries GetIntrinsicEntries ();         /* get Scope with Intrinsics */
  121. tEntries GetUnitEntries ();              /* get Scope with Units      */
  122. tEntries GetCommonEntries ();            /* get Scope with Commons    */
  123.  
  124.     /***********************************
  125.     *                                  *
  126.     *    Inserting Entries             *
  127.     *                                  *
  128.     ************************************/
  129.  
  130. void InsertUnitEntry ARGS((tObject Obj));
  131.  
  132. void InsertExternalEntry ARGS((tObject Obj));
  133.  
  134. void InsertCommonEntry ARGS((tObject Obj));
  135.  
  136. void InsertEntry ARGS((tObject Obj));
  137.  
  138.     /***********************************
  139.     *                                  *
  140.     *    Changing Entries              *
  141.     *                                  *
  142.     ************************************/
  143.  
  144. void ChangeEntry ARGS((tIdent Name, tObject Obj));
  145.  
  146.     /***********************************
  147.     *                                  *
  148.     *  Some Constants used             *
  149.     *                                  *
  150.     ************************************/
  151.  
  152. #define IntentIn     0
  153. #define IntentOut    1
  154. #define IntentInOut  2
  155.  
  156.  
  157.  
  158. # ifndef Definitions_NodeHead
  159. # define Definitions_NodeHead
  160. # endif
  161. typedef struct { Definitions_tKind yyKind; Definitions_tMark yyMark; Definitions_NodeHead } Definitions_tNodeHead;
  162. typedef struct { Definitions_tNodeHead yyHead; } yScopes;
  163. typedef struct { Definitions_tNodeHead yyHead; tDefinitions Table; tDefinitions Hidden; } ySCOPE_LIST;
  164. typedef struct { Definitions_tNodeHead yyHead; } ySCOPE_EMPTY;
  165. typedef struct { Definitions_tNodeHead yyHead; } yEntries;
  166. typedef struct { Definitions_tNodeHead yyHead; tDefinitions Elem; tDefinitions Next; } yENTRY_LIST;
  167. typedef struct { Definitions_tNodeHead yyHead; } yENTRY_EMPTY;
  168. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; } yObject;
  169. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; tDefinitions Kind; int uses; tDefinitions Dist; } yVarObject;
  170. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; tDefinitions Dist; } yTemplateObject;
  171. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; } yProcessorsObject;
  172. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; tDefinitions Components; } yTypeObject;
  173. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; int calls; tDefinitions Declarations; } yProcObject;
  174. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; int calls; tDefinitions Declarations; } yFuncObject;
  175. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; tDefinitions Declarations; } yBlockObject;
  176. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; int uses; tDefinitions Declarations; } yModuleObject;
  177. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; int size; int main; int distributed_vars; int sequence; } yCommonObject;
  178. typedef struct { Definitions_tNodeHead yyHead; tIdent ident; tTree decl; } yNameListObject;
  179. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; } yDistribution;
  180. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; } yDefaultDistribution;
  181. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; } yArrayUseDistribution;
  182. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; } ySerialDistribution;
  183. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; tIdent hostdist_id; } yHostDistribution;
  184. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; tIdent nodedist_id; DistributedDimensions dims; } yNodeDistribution;
  185. typedef struct { Definitions_tNodeHead yyHead; int size; int helpvars; tObject template; DistributedDimensions dims; } yAlignDistribution;
  186. typedef struct { Definitions_tNodeHead yyHead; } yVarDescription;
  187. typedef struct { Definitions_tNodeHead yyHead; int Intent; int dynamic; bool optional; } yVarDummy;
  188. typedef struct { Definitions_tNodeHead yyHead; tTree Val; tTree Type; } yVarConstant;
  189. typedef struct { Definitions_tNodeHead yyHead; int IsSave; int dynamic; } yVarLocal;
  190. typedef struct { Definitions_tNodeHead yyHead; tIdent Block; } yVarCommon;
  191.  
  192. union Definitions_Node {
  193.  Definitions_tKind Kind;
  194.  Definitions_tNodeHead yyHead;
  195.  yScopes Scopes;
  196.  ySCOPE_LIST SCOPE_LIST;
  197.  ySCOPE_EMPTY SCOPE_EMPTY;
  198.  yEntries Entries;
  199.  yENTRY_LIST ENTRY_LIST;
  200.  yENTRY_EMPTY ENTRY_EMPTY;
  201.  yObject Object;
  202.  yVarObject VarObject;
  203.  yTemplateObject TemplateObject;
  204.  yProcessorsObject ProcessorsObject;
  205.  yTypeObject TypeObject;
  206.  yProcObject ProcObject;
  207.  yFuncObject FuncObject;
  208.  yBlockObject BlockObject;
  209.  yModuleObject ModuleObject;
  210.  yCommonObject CommonObject;
  211.  yNameListObject NameListObject;
  212.  yDistribution Distribution;
  213.  yDefaultDistribution DefaultDistribution;
  214.  yArrayUseDistribution ArrayUseDistribution;
  215.  ySerialDistribution SerialDistribution;
  216.  yHostDistribution HostDistribution;
  217.  yNodeDistribution NodeDistribution;
  218.  yAlignDistribution AlignDistribution;
  219.  yVarDescription VarDescription;
  220.  yVarDummy VarDummy;
  221.  yVarConstant VarConstant;
  222.  yVarLocal VarLocal;
  223.  yVarCommon VarCommon;
  224. };
  225.  
  226. extern tDefinitions DefinitionsRoot;
  227. extern unsigned long Definitions_HeapUsed;
  228. extern char * Definitions_PoolFreePtr, * Definitions_PoolMaxPtr;
  229. extern unsigned short Definitions_NodeSize [29 + 1];
  230. extern char * Definitions_NodeName [29 + 1];
  231.  
  232. extern tDefinitions Definitions_Alloc ();
  233. extern tDefinitions MakeDefinitions ARGS((Definitions_tKind yyKind));
  234. extern bool Definitions_IsType ARGS((register tDefinitions yyt, register Definitions_tKind yyKind));
  235.  
  236. extern tDefinitions mScopes ARGS(());
  237. extern tDefinitions mSCOPE_LIST ARGS((tDefinitions pTable, tDefinitions pHidden));
  238. extern tDefinitions mSCOPE_EMPTY ARGS(());
  239. extern tDefinitions mEntries ARGS(());
  240. extern tDefinitions mENTRY_LIST ARGS((tDefinitions pElem, tDefinitions pNext));
  241. extern tDefinitions mENTRY_EMPTY ARGS(());
  242. extern tDefinitions mObject ARGS((tIdent pident, tTree pdecl));
  243. extern tDefinitions mVarObject ARGS((tIdent pident, tTree pdecl, tDefinitions pKind, int puses, tDefinitions pDist));
  244. extern tDefinitions mTemplateObject ARGS((tIdent pident, tTree pdecl, tDefinitions pDist));
  245. extern tDefinitions mProcessorsObject ARGS((tIdent pident, tTree pdecl));
  246. extern tDefinitions mTypeObject ARGS((tIdent pident, tTree pdecl, tDefinitions pComponents));
  247. extern tDefinitions mProcObject ARGS((tIdent pident, tTree pdecl, int pcalls, tDefinitions pDeclarations));
  248. extern tDefinitions mFuncObject ARGS((tIdent pident, tTree pdecl, int pcalls, tDefinitions pDeclarations));
  249. extern tDefinitions mBlockObject ARGS((tIdent pident, tTree pdecl, tDefinitions pDeclarations));
  250. extern tDefinitions mModuleObject ARGS((tIdent pident, tTree pdecl, int puses, tDefinitions pDeclarations));
  251. extern tDefinitions mCommonObject ARGS((tIdent pident, tTree pdecl, int psize, int pmain, int pdistributed_vars, int psequence));
  252. extern tDefinitions mNameListObject ARGS((tIdent pident, tTree pdecl));
  253. extern tDefinitions mDistribution ARGS((int psize, int phelpvars));
  254. extern tDefinitions mDefaultDistribution ARGS((int psize, int phelpvars));
  255. extern tDefinitions mArrayUseDistribution ARGS((int psize, int phelpvars));
  256. extern tDefinitions mSerialDistribution ARGS((int psize, int phelpvars));
  257. extern tDefinitions mHostDistribution ARGS((int psize, int phelpvars, tIdent phostdist_id));
  258. extern tDefinitions mNodeDistribution ARGS((int psize, int phelpvars, tIdent pnodedist_id, DistributedDimensions pdims));
  259. extern tDefinitions mAlignDistribution ARGS((int psize, int phelpvars, tObject ptemplate, DistributedDimensions pdims));
  260. extern tDefinitions mVarDescription ARGS(());
  261. extern tDefinitions mVarDummy ARGS((int pIntent, int pdynamic, bool poptional));
  262. extern tDefinitions mVarConstant ARGS((tTree pVal, tTree pType));
  263. extern tDefinitions mVarLocal ARGS((int pIsSave, int pdynamic));
  264. extern tDefinitions mVarCommon ARGS((tIdent pBlock));
  265.  
  266. extern void BeginDefinitions ();
  267. extern void CloseDefinitions ();
  268.  
  269. # endif
  270.